package com.yanqu.road.server.cmd.activity.summergames;

import com.google.protobuf.InvalidProtocolBufferException;
import com.yanqu.road.pb.activity.SummerGamesProto;
import com.yanqu.road.pb.syncMessage.SyncMessage;
import com.yanqu.road.server.game.service.IGameServiceCommand;
import com.yanqu.road.server.manger.activity.summergames.SummerGamesActivityMgr;
import com.yanqu.road.sync.message.SyncResponse;

public class SummerGamesSearchUserServiceCommand implements IGameServiceCommand {

    @Override
    public SyncResponse execute(SyncMessage.Request request) throws InvalidProtocolBufferException {
        SummerGamesProto.CrossSummerGamesSearchUserReqMsg reqMsg = SummerGamesProto.CrossSummerGamesSearchUserReqMsg.parseFrom(request.getDataBytes());
        int activityId = reqMsg.getActivityId();
        long userId = reqMsg.getUserId();
        SyncResponse syncResponse = new SyncResponse();
        syncResponse.setResponseBuilder(SummerGamesActivityMgr.searchUser(activityId, userId));
        return syncResponse;
    }
}
